import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

// import OnView from '../views/OneView.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',  //代表根路径
    redirect:"/login" //想让谁是首页 你就重定向到谁
  },
  {
    path:'/home',
    name:'home',
    component: HomeView,
    meta:{
      title:"首页"
    },
    children:[
      {
        path:"message",
        component:() => import('../views/FashionView.vue')
      },
      {
        path:"user",
        component:() => import('../views/RockView.vue')
      },
      {
        path:"page",
        component:() => import('../views/MyPage.vue')
      },
      {
        path:"father",
        component:() => import('../views/FatherView.vue')
      },
      {
        path:"sync",
        component:() => import('../views/SyncView.vue')
      },
      {
        path:"slot",
        component:() => import('../views/SlotView.vue')
      },
      {
        path:"mysass",
        component:() => import('../views/MySass.vue')
      },
      {
        path:"bro",
        component:() => import('../views/BroView.vue')
      },
      {
        path:"pro",
        component:() => import('../views/ProvideView.vue')
      },
      {
        path:"ref",
        component:() => import('../views/RefView.vue')
      },
      {
        path:"other",
        component:() => import('../views/OtherView.vue')
      },
      {
        path:"table",
        component:() => import('../views/ElementTabe.vue')
      },
      {
        path:"form",
        component:() => import('../views/ElementForm.vue')
      },
      {
        path:"zuoye",
        component:() => import('../views/ZuoyeView.vue')
      },
      {
        path:"update",
        component:() => import('../views/UpdateImg.vue')
      },
      {
        path:"keep",
        component:() => import('../views/KeepView.vue')
      },
      {
        path:"ani",
        component:() => import('../views/AnimateView.vue')
      },
      {
        path:"vuex",
        component:() => import('../views/VuexView.vue')
      },
      {
        path:"map",
        component:() => import('../views/MapView.vue')
      },
      {
        path:"mix",
        component:() => import('../views/MixinsView.vue')
      },
      {
        path:"view",
        component:() => import('../views/MyView.vue')
      },
      {
        path:"axios",
        component:() => import('../views/AxiosView.vue')
      },
      {
        path:"jiekou",
        component:() => import('../views/JiekouView.vue')
      },
      {
        path:"sort",
        component:() => import('../views/SortView.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue'),
    meta:{
      title:"登陆"
    }
  },
  {
    path: '/about',
    name: 'about',
    meta:{
      title:"关于"
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue'),
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})



export default router
